package meatslope2.gameengine.primatives;

public class HitInfo 
{
	// ===========================================================
	// Members
	// ===========================================================
	private boolean hit = false;
	private Vector2 hitPoint = new Vector2();
	private Vector2 hitNormal = new Vector2();
	
	// ===========================================================
	// Getters/Setters
	// ===========================================================
	
	public final void setHit(boolean hit)
	{
		this.hit = hit;
	}
	
	public final boolean isHit()
	{
		return this.hit;
	}

	public final void setHitPoint(Vector2 hitPoint)
	{
		this.hitPoint = hitPoint;
	}
	
	public final Vector2 getHitPoint()
	{
		return this.hitPoint;
	}
	
	public final void setHitNormal(Vector2 hitNormal)
	{
		this.hitNormal = hitNormal;
	}
	
	public final Vector2 getHitNormal()
	{
		return this.hitNormal;
	}
	
	// ===========================================================
	// Methods
	// ===========================================================
	
	public final void reset()
	{
		this.hit = false;
		this.hitPoint.zero();
		this.hitNormal.zero();
	}

	public final void set(HitInfo otherHitInfo) 
	{
		this.hit = otherHitInfo.isHit();
		this.hitPoint.set(otherHitInfo.getHitPoint());
		this.hitNormal.set(otherHitInfo.getHitNormal());
	}
}
